package com.jacen.fzxs.web;

import java.util.Set;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import com.jacen.fzxs.util.StrUtils;

public class CheckRightTag extends TagSupport {
	
	private String rightMark;
	
	public String getRightMark() {
		return rightMark;
	}

	public void setRightMark(String rightMark) {
		this.rightMark = rightMark;
	}

	@Override
	public int doStartTag() throws JspException {
		Set<String> rightSets = (Set<String>) pageContext.getSession().getAttribute("rightMarkSession");
		if(StrUtils.isEmpty(rightMark)){
			return SKIP_BODY;
		}
		if(rightSets==null){
			return SKIP_BODY;
		}
		if(!rightSets.contains(rightMark)){
			return SKIP_BODY;
		}
		return EVAL_BODY_INCLUDE;
	}
	
	
	
}
